package it.unina.lab.testing;

import it.unina.lab.parsing.HandlerParsingContexts;

import java.util.HashMap;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.helpers.DefaultHandler;

import diuf.diva.hephaistk.fusion.model.ContextHL;

public class ParsingContexts {

	
	
	
	private static HashMap<String, ContextHL> contexts = null;
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			 
			SAXParserFactory factory = SAXParserFactory.newInstance();
			SAXParser saxParser = factory.newSAXParser();
			contexts = new HashMap<String, ContextHL>();
			DefaultHandler handler = new HandlerParsingContexts(contexts) ;
			
			
		       saxParser.parse("musicplayerconfig.xml", handler);
		       System.out.println(contexts);
		       System.out.println(contexts.size());
		 
		     } catch (Exception e) {
		       e.printStackTrace();
		     }
		 
		   }
}
